package com.szy.pojo;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 博客表
 * @TableName article
 */
@Data
public class Article implements Serializable {
    /**
     * 文章ID
     */
    private Integer articleId;

    /**
     * 用户ID
     */
    private Integer articleUserId;

    /**
     * 标题
     */
    private String articleTitle;

    /**
     * 内容
     */
    private String articleContent;

    /**
     * 概述
     */
    private String articleSummary;

    /**
     * 访问量
     */
    private Integer articleViewCount;

    /**
     * 评论数
     */
    private Integer articleCommentCount;

    /**
     * 点赞数
     */
    private Integer articleLikeCount;

    /**
     * 状态 0-草稿 1-已发布
     */
    private Integer articleStatus;

    /**
     * 更新时间
     */
    private Date articleUpdateTime;

    /**
     * 创建时间
     */
    private Date articleCreateTime;

    /**
     *存储创建时间的格式化结果
     */
    private String articleCreateTimeFormat;
    /**
     * 时间间隔
     * 天
     * 周
     * 月
     * 年
     */
    private String articleCreatePeriod;
    /**
     * 缩略图:路径
     */
    private String articleThumbnail;

    private User articleAuthor;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("articleId=").append(articleId);
        sb.append(", articleUserId=").append(articleUserId);
        sb.append(", articleTitle=").append(articleTitle);
        sb.append(", articleContent=").append(articleContent);
        sb.append(", articleSummary=").append(articleSummary);
        sb.append(", articleViewCount=").append(articleViewCount);
        sb.append(", articleCommentCount=").append(articleCommentCount);
        sb.append(", articleLikeCount=").append(articleLikeCount);
        sb.append(", articleStatus=").append(articleStatus);
        sb.append(", articleUpdateTime=").append(articleUpdateTime);
        sb.append(", articleCreateTime=").append(articleCreateTime);
        sb.append(", articleThumbnail=").append(articleThumbnail);
        sb.append(", articleAuthor=").append(articleAuthor);
        sb.append("]");
        return sb.toString();
    }
}